package org.tgcms.core.samples.contentcreator.domain;

import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.tgcms.core.dal.dto.Attachment;
import org.tgcms.core.dal.dto.Page;
import org.tgcms.core.dal.dto.Template;

public class SamplePage implements Page {

	String url;

	String title;

	String content;

	Date date;

	Boolean draft;

	Template template;

	Map<String, String> attributes;

	List<Attachment> attachments;

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public Date getDate() {
		return date;
	}

	public void setDate(Date date) {
		this.date = date;
	}

	public Boolean isDraft() {
		return draft;
	}

	public void setDraft(Boolean draft) {
		this.draft = draft;
	}

	public Template getTemplate() {
		return template;
	}

	public void setTemplate(Template template) {
		this.template = template;
	}

	public Map<String, String> getAttributes() {
		if(attributes== null) {
			attributes = new HashMap<String, String>();
		}
		return attributes;
	}

	public void setAttributes(Map<String, String> attributes) {
		this.attributes = attributes;
	}

	@SuppressWarnings("unchecked")
	public List<Attachment> getAttachments() {
		if(attachments == null) {
			attachments = new ArrayList<Attachment>();
		}
		return (List<Attachment>)(List<?>) attachments;
	}

	public void setAttachments(List<Attachment> attachments) {
//		this.attachments = attachments;
		throw new RuntimeException("Not implemented");
	}
	
}
